1. Field of the Invention
The invention relates to communication control method and system for connecting equipment such as initiator (host computer) and target (printer or the like).
2. Related Background Art
In recent years, the IEEE1394 interface is being used to connect a computer and peripheral equipment or connect both peripheral equipment. The IEEE1394 interface has a processing speed higher than that of the hand shaking system such as a centronics interface or the like and can perform a bidirectional communication. The IEEE1394 interface is also an interface for a memory bus model and equipment connected by it can read or write data at a designated address from/to partner""s equipment.
According to IEEE1394, although a protocol for a physical layer and a link layer to apply it in a wide range is determined, a detailed protocol for each equipment is not decided. Therefore, a protocol for a transport layer such as SBP (Serial Bus Protocol)-2 or the like using IEEE1394 has been proposed as physical/link layers. The transport layer is a layer which provides a data transmitting function for an application. The applications using such a layer can mutually exchange data.
The SBP-2 protocol is a protocol utilizing a feature as a memory bus model of IEEE1394, and the reception side of data can receive the data in accordance with circumstances of itself. On the other hand, as protocols other than SBP-2, there are a protocol which can transmit data which is asynchronously generated and a protocol which can realize multichannels. However, such protocols cannot utilize the feature as a memory bus model of IEEE1394. That is, in case of a communication between a host and a printer, data transmission cannot be performed in accordance with circumstances on the printer side and the host has to perform the data transmission while monitoring a status of the printer.
According to SBP-2, in case of transmitting data, an operation called xe2x80x9cloginxe2x80x9d is first performed on the transmission side, thereby establishing a channel with a communication partner. In this instance, the login side is called an initiator and the partner side connected to the initiator is called a target. The data transmission is performed by reading or writing data from/into a buffer of the initiator from the target in accordance with an instruction from the initiator. In such a system, the initiator forms an ORB (Operation Request Block) in which an address, a size, and the like of the buffer in which the data to be transmitted has been stored have been written and notifies the target of the address of the ORB. The target reads out or writes the data from/to the initiator on the basis of the address and size written in the ORB in accordance with its own circumstances, forms a status block after completion of those processes, and notifies the initiator of states of the processes.
In case of performing a communication by using the SBP-2 protocol established on IEEE1394, particularly, in the case where a data source such as a host computer or the like is used as an initiator and it is applied to a data transmission from the initiator to peripheral equipment such as a printer apparatus or the like as a target, there are the four following problems.
(Problem 1)
A procedure is complicated because of a full duplex communication.
In SBP-2, the data transmission is fundamentally managed by the initiator and the target cannot perform the asynchronous data transmission to the initiator. That is, in SBP-2, when the target wants to transmit data to the initiator, it sends a data reading request to the initiator in an unsolicited status. The initiator forms an ORB in response to it and includes the formed ORB into the end of a list of the pending ORBs (a data transmission request from the initiator to the target and the like are included). Since the ORBs are processed in order from the head, the data is transmitted from the target to the initiator for the first time when the process of the ORB on the initiator side is progressed and the ORB processes in response to the data reading request from the target instead of a timing when the target issues the reading request to the initiator. That is, in the case where the bidirectional asynchronous data transmission cannot be performed and the data to be transmitted from the target to the initiator is asynchronously generated, for example, assuming that the target is a printer, in the case where an error occurs in the printer, or the like, the data to be transmitted immediately to the initiator cannot be momentarily transmitted.
Therefore, for example, to immediately send data which is asynchronously generated from the printer to the host, a login procedure has to be performed by using the printer as an initiator and a data transmission in which the host computer is used as a target has to be performed.
In a situation such that the host computer and the printer mutually login and each of them is the initiator or the target as mentioned above, a process as an initiator and a process as a target have to be provided for both the host computer and the printer. The operation of login has to be also performed by the printer. In a peripheral apparatus such as a printer for handling an image, a large amount of memory resources or processor resources are consumed for image processes. Therefore, costs have to be shaved by simplifying a construction of the apparatuses or resources which are used for applications other than the image processing application have to be saved as much as possible in order to perform the processes promptly. However, as mentioned above, the more often the processes are executed, the larger amount of resources are consumed. This is contrary to the purpose of shaving costs and realization of high efficiency of processes.
As for the relation between the host computer and the printer, data flowing in each direction is correlated as a relation between print data and a processing situation of it. However, if a channel is set by an independent login with respect to each direction, those data and response have to be mutually concerned and it is necessary to newly add a processing procedure for such a purpose.
As mentioned above, it is not proper to apply IEEE1394 and SBP-2 to the communication between the host computer and the printer apparatus as they are. It is difficult to reduce the resources necessary for each apparatus and improve the efficiency.
(Problem 2)
Multichannels cannot be realized.
In recent years, a hybrid apparatus in which various functions are combined as peripheral apparatuses is being used. For example, there is a digital hybrid apparatus or the like such that a facsimile apparatus is used as a scanner unit apparatus, a printer unit apparatus, and a facsimile and can be used from the host computer or the like. When such a hybrid apparatus is used, if a communication is performed through a plurality of independent channels every unit apparatus function, a plurality of functions can be simultaneously used.
In SBP-2, however, since the multichannels cannot be provided, it is difficult to simultaneously use such unit apparatus functions.
Even if the multichannels are realized, only a command called xe2x80x9cAbort Task Setxe2x80x9d which has been determined in the SBP-2 layer has means for cancelling an error situation such as protocol contravention or the like. According to such a command, all of the ORBs chained to the ORB list are erased and the channel which is operating irrespective of the error situation is also reset. It is impossible to manage the communication path using the channel in which no error occurs or the unidirectional path constructing the channel (for example, in case of a full duplex channel, one channel is constructed by a pair of an upstream path and a downstream path) as a unit.
(Problem 3)
It is impossible to cope with a bus reset.
In IEEE1394, a bus reset occurs when a status change which becomes a cause of a change of a network construction such that new equipment is connected to a 1394 serial bus or the equipment is disconnected or a power source of the connected equipment is turned on or off occurs. The bus reset occurs when a node which detects the status change as mentioned above on the bus transmits a bus resetting signal onto the bus. The generated bus resetting signal is transmitted from one node to another. When all nodes on the network receive the bus resetting signal, a series of operations for the bus reset is performed in each node.
As mentioned above, the bus reset occurs asynchronously with the process in a node on a network. Even in case of a node which is not concerned with a node which becomes a cause of the bus reset with respect to the application, if the bus reset has once occurred, a bus resetting process has to be performed. In the bus resetting step, in the node which performs a communication by SBP-2, the set connection is disconnected. Even if it is re-connected, a guarantee such that the process can be continued from the state just before the bus reset is not given.
Since the initiator transmits commands to the target so as not to exceed the number of commands in each queue, there is a case where commands assured in the queues which are not used are in vain.
The invention is made in consideration of the above conventional technique and it is an object of the invention to provide communication control method and apparatus which enable a full duplex communication (mutually asynchronous bidirectional communication) to be performed by a login of once and can efficiently use resources such as processes and memories necessary for exchanging data.
Another object of the invention is to provide communication control method and apparatus for realizing multichannels which can be managed on a unit basis of a channel or a path.
Still another object of the invention is to provide communication control method and apparatus which guarantee the continuation of processes from a state just before a bus reset even if the bus reset occurs.
Further another object of the invention is to provide communication control method and apparatus which can efficiently use resources by unitarily managing the number of commands which can be transmitted from an initiator to a target instead of managing it every queue of the target.
Further another object of the invention is to provide communication control method and apparatus in which an initiator dynamically performs an allocation to all of command pool areas of a target in a multiplex path by queues, thereby improving communicating efficiency and resource using efficiency of the target, and the number of command pool areas of the target is increased or decreased in accordance with the number of queues which are used for connection, thereby improving the resource using efficiency of the target.
To accomplish the above objects, according to the invention, there is provided a communication control method of communicating between an initiator connected through a plurality of paths and a target,
wherein the initiator uses at least one of the plurality of paths and transmits an erase command of a desired path different from the path to the target,
when the erase command is received, the target aborts the communication using the desired path, erases the target side of this path, and sends a response showing this fact to the initiator, and
when the response is received from the target, the initiator erases the initiator side of the path as a target of the erasure.
Preferably, when the communication using the desired path is aborted, if the command received from the path is being executed, the target aborts the execution.
More preferably, when the response is received from the target, the initiator erases a command in a process waiting state and erases the initiator side of the path as a target of the erasure.
Further preferably, when the command is transmitted from the initiator through the path in which the target side has been erased, the target informs the initiator of a fact that the destination is incorrect.
There is also provided a communication control method of communicating between an initiator connected through a plurality of paths and a target having a function to erase all commands in the paths by an abort command from the initiator,
wherein when the abort command is received from the initiator, the target erases all of the commands in the paths, aborts an execution of a command which is being executed, stores an identifier of the aborted command and a position of data which is not processed yet, erases the command, and sends a response showing this fact to the initiator,
when the response is received from the target, the initiator discriminates the presence or absence of an error for each of the plurality of paths, re-transmits the command to which the identifier of the command aborted by the target has been assigned and the subsequent commands to the target with respect to the path having no error, and cancels all of the aborted command and subsequent commands with respect to the path having an error, and
when the command transmitted from the initiator is received after the process of the aborted command, the target discriminates whether the command has the same identifier as that of the aborted command or not, and resumes the process of the command from the stored position of the unprocessed data if it has the same identifier.
Preferably, the initiator notifies a requesting source which issued the aborted command of a fact that the command was aborted with respect to the path having an error after the reception of the response from the target, and when a request to re-transmit the command is issued from the requesting source, the initiator issues a command having the same identifier as that of the aborted command to the target.